// // Copyright (c) 2009 All Right Reserved // // Stephen Toub // stoub@microsoft.com // 2009-01-01 // Contains ... // Classes for interop with Win32 MCI and low-level MIDI API using System; using System.Collections.ObjectModel; using JetBrains.Annotations; namespace LargoCommon.Midi { /// Midi Devices. [UsedImplicitly] public sealed class MidiDevices { /// /// The maximum name length /// [UsedImplicitly] public const int MaxNameLength = 32; #region Constructors /// Initializes a new instance of the MidiDevices class. public MidiDevices() { int deviceCount = MidiInternalDevices.GetNumberOfDevices(); if (deviceCount < 0) { throw new InvalidOperationException("Device-count cannot be negative."); } //// this.Devices = new MidiOutcaps[this.deviceCount]; this.Items = new Collection(); for (var deviceId = 0; deviceId < deviceCount; ++deviceId) { var md = new MidiDeviceItem(deviceId); this.Items.Add(md); } } #endregion /// /// Gets Midi Device Items. /// /// General property. public Collection Items { get; } } }